package com.robot.console.util;

import java.util.Random;

public class RandomInfo
{
	private static String base = "1234 567890 QWERTYUIOPASD FGHJKLZXCVBNM qwertyuiopasd fghjklzxcvbnm ";
	private static Random r = new Random();

	public static String getRandomEmail()
	{
		int length = r.nextInt(10);
		StringBuffer emailBuffer = new StringBuffer();
		for (int i = 0; i < length; i++)
		{
			emailBuffer.append(base.charAt(r.nextInt(base.length() - 1)));
		}
		emailBuffer.append("@");
		length = r.nextInt(10);
		for (int i = 0; i < length; i++)
		{
			emailBuffer.append(base.charAt(r.nextInt(base.length() - 1)));
		}
		emailBuffer.append(".");
		length = r.nextInt(3);
		for (int i = 0; i < length; i++)
		{
			emailBuffer.append(base.charAt(r.nextInt(base.length() - 1)));
		}
		return emailBuffer.toString();
	}

	public static StringBuffer getRandomMsg(long length)
	{
		StringBuffer msg = new StringBuffer();
		for (int i = 0; i < length; i++)
		{
			msg.append(base.charAt(r.nextInt(base.length() - 1)));
		}
		return msg;
	}
}
